import '@/style/index.less'
import { createApp } from 'vue'
import App from './App.vue'
import setupRouterGuard from '@/router/guard'
import router from '@/router'
import { setupStore } from '@/store'
import { setupI18n } from '@/locales/setupI18n'
import { initAppConfigStore } from '@/settings/initAppConfig'
import { registerGlobComp } from '@/components/registerGlobComp'
import initAppUtils from '@/utils/app/index'

declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $antIcons: any
    $getEnumDisplayName: any
    $formatToDate: any
  }
}

async function bootstrap() {
  const app = createApp(App)

  setupStore(app)

  initAppConfigStore()

  registerGlobComp(app)

  await setupI18n(app)

  await initAppUtils(app)
  
  setupRouterGuard(router)
  
  app.use(router).mount('#app')
  
  console.log('页面挂载完毕');
}

bootstrap()